<script>

  function call(obj, fn, ...args) {
    obj = obj || window;
    const symbol = Symbol();
    obj[symbol] = fn;
    obj[symbol](...args);
    delete obj[symbol];
  }

  function apply(obj, fn, args) {
    obj = obj || window;
    const symbol = Symbol();
    obj[symbol] = fn;
    obj[symbol](...args);
    delete obj[symbol];
  }

  function bind(obj, fn) {
    obj = obj || window;
    return function (...args) {
      fn.apply(obj, args);
    }
  }

  var obj = {
    name: 'ly'
  }

  function test(type) {
    console.log(type, this.name)
  }

  call(obj, test, 'call');
  apply(obj, test, ['apply']);

  bind(obj, test)('bind');

</script>